<template>
	<view>
		<view class="noteCard">
			<view class="top">
				<view class="left">
					<view class="course">
						{{faultItem.subjectName }}
					</view>
					<view class="courseDetail">
						{{faultItem.pointName }}
					</view>
				</view>
				<view class="right">
					<!-- <view class="faultType">{{faultItem.queTypeName}}</view> -->
					<u-tag class="faultType" :text="this.faultItem.queTypeName" mode="dark" />
					<span class="faultTime">错误<span class="faultTimeNum">{{faultItem.errorCount}}</span>次</span>
				</view>
			</view>
			<view class="mainContent">
				<!-- {{faultItem.queContent}} -->
				<view class="">
					<u-parse :html="faultItem.queContent"></u-parse>
				</view>
			</view>
			<view class="bottom">
				<span class="time">{{faultItem.createTime}}</span>
				<!-- <u-icon class="enterArrow" name="arrow-right" color="#eeeeee" size="28"></u-icon> -->
				<view class="funcGroup" @click="checkQue">
					<u-icon class="funcBtn" name="eye"></u-icon>
					<span>试题</span>
				</view>
			</view>
		</view>
		<!-- 渲染题目详情 -->
		<u-popup v-model="showDetail" mode="center" border-radius="20">
			<view class="QuesModal">
				<scroll-view scroll-y="true" style="height: 700rpx;">
					<view>
						<exam-question :queDetail="queDetail"></exam-question>
					</view>
				</scroll-view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import Modal from '@/components/dyw-answer/modal.vue'
	export default {
		props: ['faultItem'],
		data() {
			return {
				showDetail: false,
				queDetail: {}
			}
		},
		methods: {
			checkQue() {
				var that = this
				this.showDetail = !this.showDetail
				this.$api.errorQueDetail(this.faultItem.errorId)
					.then(res => {
						console.log('题目详情', res)
						that.queDetail = res.values
					})
			},
		},
		components: {
			Modal
		},
		filters: {
			testTypeFilter(item) {
				switch (item) {
					case 1:
						return '判断题';
					case 2:
						return '单选题';
					case 3:
						return '多选题';
				}
			},

		},
	}
</script>

<style lang="scss">
	.noteCard {
		box-shadow: 0 0 5px 1px rgba($color: #000000, $alpha: 0.1);
		margin: 15upx;
		border-radius: 15upx;
		padding: 15rpx 30rpx;
		// padding-bottom: 15rpx;

		.top {
			display: flex;
			justify-content: space-between;

			.left {
				.course {
					font-weight: bold;
					font-size: 32upx;
				}

				.courseDetail {
					color: #7f878c;
					line-height: 50rpx;
				}
			}

			.right {
				letter-spacing: 0.2em;
				display: flex;
				flex-direction: column;

				.faultTime {
					line-height: 55upx;

					.faultTimeNum {
						font-weight: bold;
						color: #2979ff;
					}
				}
			}
		}

		.mainContent {
			line-height: 40upx;
			padding: 5rpx 0;
			border-bottom: #d9d9d9 1px dashed;
		}

		.bottom {
			padding-top: 5rpx;
			display: flex;
			justify-content: space-between;
			color: #7f878c;

			.funcBtn {
				margin-right: 10rpx;
				font-size: 34rpx;
			}
		}

		.QuesModal {
			// padding: 40rpx;
			padding: 24rpx;
			
		}
	}
</style>
